package com.mtz.dateobject;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mtz.enums.DeleteEnum;
import com.mtz.enums.UserServerEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 * 后台管理系统用户表
 * @author 煜赜
 * @date 2018/11/21 10:12
 */
@Data
@Entity
@DynamicUpdate
@DynamicInsert
public class UserServer {

    /** 用户id **/
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /** 用户名 **/
    private String username;

    /** 用户密码 **/
    @JsonIgnore
    private String password;

    /** 用户类型 **/
    private Integer type = UserServerEnum.NORMAL_USER.getCode();

    /** 信息状态(0未删除,1已删除) **/
    private Integer isDeleted = DeleteEnum.UN_CHECKED.getCode();

    private Date createTime;

    private Date updateTime;
}
